#include "LinkedList.h"
//使用成员函数operator+=来实现加号运算符重载
const LinkedList operator + (const LinkedList&lhs,const LinkedList&rhs){
    LinkedList ans(lhs);
    return ans += rhs;
}
//使用成员函数compareTo来实现等于号运算符重载
bool operator == (const LinkedList&lhs,const LinkedList&rhs){
    return 0 == lhs.compareTo(rhs);
}
//其他关系运算符重载还是使用等于号与小于号组合得到
bool operator != (const LinkedList&lhs,const LinkedList&rhs){
    return ! ( lhs == rhs );
}
//使用成员函数compareTo来实现小于号运算符重载
bool operator < (const LinkedList&lhs,const LinkedList&rhs){
    return lhs.compareTo(rhs) < 0;
}
bool operator <= (const LinkedList&lhs,const LinkedList&rhs){
    return ( lhs < rhs ) || ( lhs == rhs );
}
bool operator > (const LinkedList&lhs,const LinkedList&rhs){
    return ! ( lhs <= rhs );
}
bool operator >= (const LinkedList&lhs,const LinkedList&rhs){
    return ! ( lhs < rhs );
}
//使用成员函数disp来实现流输出运算符重载
ostream& operator << (ostream&os,const LinkedList&rhs){
    rhs.disp(os);
    return os;
}